<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<base href="<%=basePath%>">

<title>用户注册</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link href="/sbm/css/screen.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="js/dateTime.js"></script>

<script type="text/javascript"
	src="<%=path %>/My97DatePicker/WdatePicker.js"></script>

<script language="javascript">
	function mycheck() {
		if (myform.name.value == "") {
			alert("项目名称不能为空！");
			myform.name.focus();
			return false;
		}
		if((myform.startdate.value != "")&&(myform.deadline.value != "")){
			if(myform.startdate.value > myform.deadline.value){
				alert("项目起始时间不能晚于结束时间！");
				myform.startdate.focus();
				return false;
			}
		}
		if (myform.startdate.value == "") {
			if (confirm("项目起始时间未定？")) {
				return true;
			}
			return false;
		}
		if (myform.deadline.value == "") {
			if (confirm("项目结束时间未定？")) {
				return true;
			}
			return false;
		}
	}
</script>

</head>

<body>
	<s:form action="addtask" method="post" enctype="multipart/form-data"
		name="myform">
		<table width="600px" align="center" class="class1">
			<tr>
				<td colspan="3" align="right"><span class="title">新增一个项目</span>
				</td>
			</tr>
			<tr>
				<td width="10%">&nbsp;</td>
				<td width="60%">
					<table>

						<tr>
							<td width="25%" height="38">项目名称</td>
							<td height="38" width="35%"><s:textfield name="task.name"
									id="name" size="20" /></td>
						</tr>
						<tr>
							<td>开始时间</td>
							<td><s:textfield name="task.startdate"
									onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="startdate"
									size="20" />
							</td>
						</tr>
						<tr>
							<td>结束时间</td>
							<td><s:textfield name="task.deadline"
									onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="deadline"
									size="20" />
							</td>
						</tr>
						<tr>
							<td>项目状态</td>
							<td><input type="radio" name="task.status" value="1">活跃
								&nbsp;&nbsp;<input type="radio" name="task.status" value="0">不活跃
							</td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td>&nbsp;&nbsp;&nbsp;&nbsp;<input name="Submit"
								type="submit" value="确 认" onClick="return mycheck();" />
							</td>
						</tr>
						<tr>
							<td height="35" colspan="2" class="top_hui_text" align="center"
								colspan="2"><span class="errorAndmes"><s:actionerror
										cssStyle="font-family: Arial,Helvetica,sans-serif" /> </span>
							</td>
						</tr>
					</table></td>
				<td width="30%">&nbsp;</td>
			</tr>
		</table>
	</s:form>
</body>
</html>
